<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
test(() =>
    assert_selection(
        [
            '<div contenteditable><span>',
            '<span style="white-space:pre">\t\t</span>',
            '|foo',
            '</span></div>',
        ].join(''),
        'delete',
        [
            '<div contenteditable><span>',
            '<span style="white-space:pre">\t|</span>',
            'foo',
            '</span></div>',
        ].join('')),
    'Delete tab character in SPAN from caret after SPAN');

test(() =>
    assert_selection(
        [
            '<div contenteditable><span>',
            'foo',
            '<span style="white-space:pre">\t\t|</span>',
            '</span></div>',
        ].join(''),
        'delete',
        [
            '<div contenteditable><span>',
            'foo',
            '<span style="white-space:pre">\t|</span>',
            '</span></div>',
        ].join('')),
    'Delete tab character in SPAN from caret in same SPAN');

test(() =>
    assert_selection(
        [
            '<div contenteditable><span>',
            '<br>',
            '<span style="white-space:pre">\t\t|</span>',
            'foo',
            '</span></div>',
        ].join(''),
        'delete',
        [
            '<div contenteditable><span>',
            '<br>',
            '<span style="white-space:pre">\t|</span>',
            'foo',
            '</span></div>',
        ].join('')),
    'Delete tab character after BR');
</script>
